import type { postOrPutType } from "@/constants";
import type { HasId, IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson } from "@/utils/request.js";
const url = "/back/douyin-oriented-cps";
/* 定向佣金计划：获取佣金计划信息 */
export const getDouyinOrientedCpsInfo = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 定向佣金计划：获取佣金计划 详情信息 */
export const getDouyinOrientedCpsByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/* 定向佣金计划：新增，更新 佣金计划 */
export const commonDouyinOrientedCpsInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 定向佣金计划：修改计划状态 */
export const putDouyinOrientedCpsPlanStatusInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/update-plan-status", params, "PUT");
};
